<template>
	<div class="content">
		<el-form ref="form" :rules="rules" :model="form">
		<div class="tabs">
			<el-tabs v-model="activeName" @tab-click="handleClick">
				<el-tab-pane label="基本信息" name="first">
						<el-descriptions class="test-report" :title="titname" :column="2"  border>
								<el-descriptions-item >
									<template slot="label"><span style="color: red;">*</span>里程碑</template>
									<el-form-item prop="company">
										<el-input v-model="form.company" placeholder="请输入申请公司" :disabled="num == 3" clearable></el-input>
									</el-form-item>
								</el-descriptions-item>
							<el-descriptions-item>
								<template slot="label"><span style="color: red;">*</span>产品名称</template>
								<el-form-item prop="product_name">
									<el-input v-model="form.product_name" placeholder="请输入产品名称" :disabled="num == 3" clearable></el-input>
								</el-form-item>
							</el-descriptions-item>
							<el-descriptions-item label="产品Model">
								<el-form-item prop="product_model">
									<el-input v-model="form.product_model" placeholder="请输入产品Model" :disabled="num == 3" clearable></el-input>
								</el-form-item>
							</el-descriptions-item>
							<el-descriptions-item label="测试设备DID">
								<el-form-item prop="prototype_did">
									<el-input v-model="form.prototype_did" placeholder="请输入测试设备DID" :disabled="num == 3" clearable></el-input>
								</el-form-item>
							</el-descriptions-item>
							<el-descriptions-item :span="12">
								<template slot="label">品牌类别</template>
								<el-select
									v-model="form.brand_type"
									placeholder="请选择品牌类别"
									filterable
									style="width:100%;"
									:disabled="num == 3">
									<el-option label="小米品牌" value="小米品牌"></el-option>
									<el-option label="米家品牌" value="米家品牌"></el-option>
									<el-option label="非米家品牌" value="非米家品牌"></el-option>
								</el-select>
							</el-descriptions-item>
							<el-descriptions-item>
								<template slot="label">销售区域</template>
								<el-select
									v-model="form.salesArea"
									@change="areaChange"
									placeholder="请选择销售区域"
									filterable
									style="width:100%;"
									:disabled="num == 3">
									<el-option
										v-for="(item,index) in salesOption"
										:key="index"
										:label="item.name+'-'+'('+item.server+')'"
										:value="item.name">
									</el-option>
								</el-select>
							</el-descriptions-item>
							<el-descriptions-item>
								<template slot="label">上线服务器</template>
								<el-input v-model="form.server" placeholder="请输入上线服务器" :disabled="true" clearable></el-input>
							</el-descriptions-item>
							<el-descriptions-item :span="12">
								<template slot="label">里程碑</template>
								<el-select
									v-model="form.milestone"
									placeholder="请选择里程碑"
									filterable
									style="width:100%;"
									:disabled="num == 3">
									<el-option label="封样" value="封样"></el-option>
									<el-option label="OTA迭代" value="OTA迭代"></el-option>
<!--									<el-option label="非米家品牌" value="非米家品牌"></el-option>-->
								</el-select>
							</el-descriptions-item>
							<el-descriptions-item :span="12">
								<template slot="label">测试内容</template>
								<el-select
									v-model="form.test_content"
									placeholder="请选择测试内容"
									multiple
									style="width:100%;"
									:disabled="num == 3">
									<el-option
										v-for="(item,index) in testOption"
										:key="index"
										:label="item.name"
										:value="item.name">
									</el-option>
								</el-select>
							</el-descriptions-item>
							<el-descriptions-item :span="12">
								<template slot="label">验收结论</template>
								<el-input v-model="form.acceptanceConclusion " placeholder="请输入测试内容" :disabled="num == 3" clearable></el-input>
							</el-descriptions-item>
							<el-descriptions-item :span="12">
								<template slot="label">问题统计</template>
								<el-descriptions direction="vertical" :column="4" border>
									<el-descriptions-item label="紧急状态（个）">
										<el-input type="number" min="0" v-model="form.urgent" placeholder="请输入紧急状态个数" :disabled="num == 3" clearable></el-input>
									</el-descriptions-item>
									<el-descriptions-item label="已解决（个）">
										<el-input type="number" min="0" v-model="form.urgent_solved" placeholder="请输入已解决个数" :disabled="num == 3" clearable></el-input>
									</el-descriptions-item>
									<el-descriptions-item label="未解决（个）">
										<el-input type="number" min="0" v-model="form.urgent_unsolved" placeholder="请输入未解决个数" :disabled="num == 3" clearable></el-input>
									</el-descriptions-item>
									<el-descriptions-item label="修复目标">
										<el-input v-model="form.urgent_target" placeholder="请输入修复目标" :disabled="num == 3" clearable></el-input>
									</el-descriptions-item>

									<el-descriptions-item label="严重状态（个）">
										<el-input type="number" min="0" v-model="form.severe" placeholder="请输入严重状态个数" :disabled="num == 3" clearable></el-input>
									</el-descriptions-item>
									<el-descriptions-item label="已解决（个）">
										<el-input type="number" min="0" v-model="form.severe_solved" placeholder="请输入已解决个数" :disabled="num == 3" clearable></el-input>
									</el-descriptions-item>
									<el-descriptions-item label="未解决（个）">
										<el-input type="number" min="0" v-model="form.severe_unsolved" placeholder="请输入未解决个数" :disabled="num == 3" clearable></el-input>
									</el-descriptions-item>
									<el-descriptions-item label="修复目标">
										<el-input v-model="form.severe_target" placeholder="请输入修复目标" :disabled="num == 3" clearable></el-input>
									</el-descriptions-item>

									<el-descriptions-item label="重要状态（个）">
										<el-input type="number" min="0" v-model="form.important" placeholder="请输入重要状态个数" :disabled="num == 3" clearable></el-input>
									</el-descriptions-item>
									<el-descriptions-item label="已解决（个）">
										<el-input type="number" min="0" v-model="form.important_solved" placeholder="请输入已解决个数" :disabled="num == 3" clearable></el-input>
									</el-descriptions-item>
									<el-descriptions-item label="未解决（个）">
										<el-input type="number" min="0" v-model="form.important_unsolved" placeholder="请输入未解决个数" :disabled="num == 3" clearable></el-input>
									</el-descriptions-item>
									<el-descriptions-item label="修复目标">
										<el-input v-model="form.important_target" placeholder="请输入修复目标" :disabled="num == 3" clearable></el-input>
									</el-descriptions-item>

									<el-descriptions-item label="一般状态（个）">
										<el-input type="number" min="0" v-model="form.generally" placeholder="请输入一般状态个数" :disabled="num == 3" clearable></el-input>
									</el-descriptions-item>
									<el-descriptions-item label="已解决（个）">
										<el-input type="number" min="0" v-model="form.generally_solved" placeholder="请输入已解决个数" :disabled="num == 3" clearable></el-input>
									</el-descriptions-item>
									<el-descriptions-item label="未解决（个）">
										<el-input type="number" min="0" v-model="form.generally_unsolved" placeholder="请输入未解决个数" :disabled="num == 3" clearable></el-input>
									</el-descriptions-item>
									<el-descriptions-item label="修复目标">
										<el-input v-model="form.generally_target" placeholder="请输入修复目标" :disabled="num == 3" clearable></el-input>
									</el-descriptions-item>
								</el-descriptions>
							</el-descriptions-item>
							<el-descriptions-item>
								<template slot="label">报告审核人</template>
								<el-input v-model="form.reportReviewer" placeholder="请输入报告审核人" :disabled="num == 3" clearable></el-input>
							</el-descriptions-item>
							<el-descriptions-item>
								<template slot="label">测试完成时间</template>
								<el-date-picker
									v-model="form.testCompletionTime"
									type="date"
									:disabled="num == 3"
									style="width: 100%;"
									placeholder="请选择测试完成时间">
								</el-date-picker>
							</el-descriptions-item>
						</el-descriptions>


						<div style="margin-top: 15px;">
							<div style="display: flex;justify-content: space-between;padding: 15px;background-color: #fafafa;">
								<div class="item" style="font-size: 15px;font-weight: 800;line-height: 37px;">问题</div>
								<div class="item">
									<el-button type="primary" icon="el-icon-plus" :disabled="num == 3" @click="addQuestion">新增</el-button>
									<el-button type="success" icon="el-icon-delete" :disabled="num == 3" @click="handleDeleteDetails">删除</el-button>
									<el-button type="danger" icon="el-icon-delete" :disabled="num == 3" @click="handleDeleteAllDetails">清空</el-button>
								</div>
							</div>
							<el-table :data="bcglXiangXiList"
									  :row-class-name="rowClassName"
									  @selection-change="handleDetailSelectionChange"
									  :border="true"
									  ref="tb"
									  :header-cell-style="{background:'#eef1f6'}"
									  style="width: 100%;">
								<el-table-column type="selection" width="50" align="center" />
								<el-table-column label="序号" align="center" prop="xh" width="50"></el-table-column>
								<el-table-column label="问题概要" prop="probability">
									<template slot-scope="scope">
										<el-input v-model="bcglXiangXiList[scope.row.xh-1].problemSummary" :disabled="num == 3" placeholder="请输入问题概要" clearable></el-input>
									</template>
								</el-table-column>
								<el-table-column label="问题概率" prop="probability">
									<template slot-scope="scope">
										<el-select v-model="bcglXiangXiList[scope.row.xh-1].probability" :disabled="num == 3" placeholder="请选择问题概率" style="width:100%;" >
											<el-option label="必现" value="必现"></el-option>
											<el-option label="高概率" value="高概率"></el-option>
											<el-option label="低概率" value="低概率"></el-option>
											<el-option label="仅出现1次" value="仅出现1次"></el-option>
										</el-select>
									</template>
								</el-table-column>
								<el-table-column label="问题等级" prop="grade">
									<template slot-scope="scope">
										<el-select v-model="bcglXiangXiList[scope.row.xh-1].grade" :disabled="num == 3" placeholder="请选择问题等级" style="width:100%;" >
											<el-option label="紧急" value="紧急"></el-option>
											<el-option label="严重" value="严重"></el-option>
											<el-option label="重要" value="重要"></el-option>
											<el-option label="一般" value="一般"></el-option>
										</el-select>
									</template>
								</el-table-column>
								<el-table-column label="复现步骤" prop="step">
									<template slot-scope="scope">
										<el-input v-model="bcglXiangXiList[scope.row.xh-1].step" :disabled="num == 3" placeholder="请输入复现步骤" clearable></el-input>
									</template>
								</el-table-column>
								<el-table-column label="修复手段"  prop="means">
									<template slot-scope="scope">
										<el-input v-model="bcglXiangXiList[scope.row.xh-1].means" :disabled="num == 3" placeholder="请输入修复手段" clearable></el-input>
									</template>
								</el-table-column>
								<el-table-column label="风险分析"  prop="analyze">
									<template slot-scope="scope">
										<el-input v-model="bcglXiangXiList[scope.row.xh-1].analyze" :disabled="num == 3" placeholder="请输入风险分析" clearable></el-input>
									</template>
								</el-table-column>
								<el-table-column label="解决方案建议"  prop="suggest">
									<template slot-scope="scope">
										<el-input v-model="bcglXiangXiList[scope.row.xh-1].suggest" :disabled="num == 3" placeholder="请输入解决方案建议" clearable></el-input>
									</template>
								</el-table-column>
							</el-table>
						</div>

				</el-tab-pane>
				<el-tab-pane label="修订记录" name="second">
					<div style="margin-top: 5px;">
							<div style="display: flex;justify-content: space-between;padding: 15px;background-color: #fafafa;">
								<div class="item" style="font-size: 15px;font-weight: 800;line-height: 37px;">审批人</div>
								<div class="item">
									<el-button type="primary" icon="el-icon-plus" :disabled="num == 3" @click="addapprover">新增</el-button>
									<el-button type="success" icon="el-icon-delete" :disabled="num == 3" @click="approverhandleDeleteDetails">删除</el-button>
									<el-button type="danger" icon="el-icon-delete" :disabled="num == 3" @click="approverhandleDeleteAllDetails">清空</el-button>
								</div>
							</div>
							<el-table :data="approverList"
									  :row-class-name="approverName"
									  @selection-change="approverSelectionChange"
									  :border="true"
									  ref="approvertb"
									  :header-cell-style="{background:'#eef1f6'}"
									  style="width: 100%;">
								<el-table-column type="selection" width="50" align="center" />
								<el-table-column label="序号" align="center" prop="xh" width="50"></el-table-column>
								<el-table-column label="部门名称" align="center" prop="departmentName">
									<template slot-scope="scope">
										<el-input v-model="approverList[scope.row.xh-1].departmentName" :disabled="num == 3" placeholder="请输入部门名称" clearable></el-input>
									</template>
								</el-table-column>
								<el-table-column label="签名" align="center" prop="sign">
									<template slot-scope="scope">
										<el-input v-model="approverList[scope.row.xh-1].sign" :disabled="num == 3" placeholder="请输入签名" clearable></el-input>
									</template>
								</el-table-column>
								<el-table-column label="日期" align="center" prop="date">
									<template slot-scope="scope">
										<el-date-picker
											v-model="approverList[scope.row.xh-1].date"
											type="date"
											:disabled="num == 3"
											style="width: 100%;"
											placeholder="请选择日期">
										</el-date-picker>
									</template>
								</el-table-column>
							</el-table>
						</div>
					<div style="margin-top: 15px;">
						<div style="display: flex;justify-content: space-between;padding: 15px;background-color: #fafafa;">
							<div class="item" style="font-size: 15px;font-weight: 800;line-height: 37px;">修订记录</div>
							<div class="item">
								<el-button type="primary" icon="el-icon-plus" :disabled="num == 3" @click="addrevision">新增</el-button>
								<el-button type="success" icon="el-icon-delete" :disabled="num == 3" @click="revisionhandleDeleteDetails">删除</el-button>
								<el-button type="danger" icon="el-icon-delete" :disabled="num == 3" @click="revisionhandleDeleteAllDetails">清空</el-button>
							</div>
						</div>
						<el-table :data="revisionRecordList"
								  :row-class-name="revisionName"
								  @selection-change="revisionSelectionChange"
								  :border="true"
								  ref="revisiontb"
								  :header-cell-style="{background:'#eef1f6'}"
								  style="width: 100%;">
							<el-table-column type="selection" width="50" align="center" />
							<el-table-column label="序号" align="center" prop="xh" width="50"></el-table-column>
							<el-table-column label="日期" align="center" prop="date">
								<template slot-scope="scope">
<!--									<el-input v-model="revisionRecordList[scope.row.xh-1].date" :disabled="num == 3" placeholder="请输入日期" clearable></el-input>-->
									<el-date-picker
										v-model="revisionRecordList[scope.row.xh-1].date"
										type="date"
										:disabled="num == 3"
										style="width: 100%;"
										placeholder="请选择日期">
									</el-date-picker>
								</template>
							</el-table-column>
							<el-table-column label="版本" align="center" prop="version">
								<template slot-scope="scope">
									<el-input v-model="revisionRecordList[scope.row.xh-1].version" :disabled="num == 3" placeholder="请输入版本" clearable></el-input>
								</template>
							</el-table-column>
							<el-table-column label="作者/修改人员" align="center" prop="auther">
								<template slot-scope="scope">
									<el-input v-model="revisionRecordList[scope.row.xh-1].auther" :disabled="num == 3" placeholder="请输入作者/修改人员" clearable></el-input>
								</template>
							</el-table-column>
							<el-table-column label="变更说明" align="center" prop="change">
								<template slot-scope="scope">
									<el-input v-model="revisionRecordList[scope.row.xh-1].change" :disabled="num == 3" placeholder="请输入变更说明" clearable></el-input>
								</template>
							</el-table-column>

						</el-table>
					</div>
				</el-tab-pane>
				<el-tab-pane label="测试范围" name="third">
					<div style="margin-top: 5px;">
						<div style="display: flex;justify-content: space-between;padding: 15px;background-color: #fafafa;">
							<div class="item" style="font-size: 15px;font-weight: 800;line-height: 37px;">本次测试的范围包括以下对象:</div>
							<div class="item">
							</div>
						</div>
						<el-table :data="testRangeList"
								  @selection-change="testRangeSelectionChange"
								  :border="true"
								  ref="testRangetb"
								  :header-cell-style="{background:'#eef1f6'}"
								  style="width: 100%;">
							<el-table-column  width="50" align="center" label="" prop="checked">
								<template slot-scope="scope">
									<el-checkbox v-model="scope.row.checked"></el-checkbox>
								</template>
							</el-table-column>
							<el-table-column align="center" type="index" label="序号" width="50"></el-table-column>

							<el-table-column label="测试对象类别" align="center" prop="testObject" width="300">
								<template slot-scope="scope">
									<el-input v-model="scope.row.testObject" :disabled="num == 3" placeholder="请输入测试对象类别" clearable></el-input>
								</template>
							</el-table-column>
							<el-table-column label="测试对象版本" align="center" prop="version" width="200">
								<template slot-scope="scope">
									<el-input v-model="scope.row.version" :disabled="num == 3" placeholder="请输入测试对象版本" clearable></el-input>
								</template>
							</el-table-column>
							<el-table-column label="备注" align="center" prop="remark">
								<template slot-scope="scope">
									<el-input v-model="scope.row.remark" :disabled="num == 3" placeholder="请输入备注" clearable></el-input>
								</template>
							</el-table-column>
						</el-table>
					</div>
					<div style="margin-top: 15px;">
						<div style="display: flex;justify-content: space-between;padding: 15px;background-color: #fafafa;">
							<div class="item" style="font-size: 15px;font-weight: 800;line-height: 37px;">自动化场景清单列表（若认证测试不涉及可不填写）：</div>
							<div class="item">
								<el-button type="primary" icon="el-icon-plus" :disabled="num == 3" @click="addreautomation">新增</el-button>
								<el-button type="success" icon="el-icon-delete" :disabled="num == 3" @click="automationhandleDeleteDetails">删除</el-button>
								<el-button type="danger" icon="el-icon-delete" :disabled="num == 3" @click="automationhandleDeleteAllDetails">清空</el-button>
							</div>
						</div>
						<el-table :data="automationList"
								  :row-class-name="automationName"
								  @selection-change="automationSelectionChange"
								  :border="true"
								  ref="automationtb"
								  :header-cell-style="{background:'#eef1f6'}"
								  style="width: 100%;">
							<el-table-column type="selection" width="50" align="center" />
							<el-table-column label="序号" align="center" prop="xh" width="50"></el-table-column>
							<el-table-column label="类别" align="center" prop="type" width="300">
								<template slot-scope="scope">
									<el-input v-model="automationList[scope.row.xh-1].type" :disabled="num == 3" placeholder="请输入类别" clearable></el-input>
								</template>
							</el-table-column>
							<el-table-column label="名称" align="center" prop="name" width="200">
								<template slot-scope="scope">
									<el-input v-model="automationList[scope.row.xh-1].name" :disabled="num == 3" placeholder="请输入名称" clearable></el-input>
								</template>
							</el-table-column>
							<el-table-column label="备注" align="center" prop="remark">
								<template slot-scope="scope">
									<el-input v-model="automationList[scope.row.xh-1].remark" :disabled="num == 3" placeholder="请输入备注" clearable></el-input>
								</template>
							</el-table-column>
						</el-table>
					</div>
					<div style="margin-top: 15px;">
						<div style="display: flex;justify-content: space-between;padding: 15px;background-color: #fafafa;">
							<div class="item" style="font-size: 15px;font-weight: 800;line-height: 37px;">Push消息清单列表（若认证测试不涉及可不填写）：</div>
							<div class="item">
								<el-button type="primary" icon="el-icon-plus" :disabled="num == 3" @click="addpush">新增</el-button>
								<el-button type="success" icon="el-icon-delete" :disabled="num == 3" @click="pushhandleDeleteDetails">删除</el-button>
								<el-button type="danger" icon="el-icon-delete" :disabled="num == 3" @click="pushhandleDeleteAllDetails">清空</el-button>
							</div>
						</div>
						<el-table :data="pushList"
								  :row-class-name="pushName"
								  @selection-change="pushSelectionChange"
								  :border="true"
								  ref="pushtb"
								  :header-cell-style="{background:'#eef1f6'}"
								  style="width: 100%;">
							<el-table-column type="selection" width="50" align="center" />
							<el-table-column label="序号" align="center" prop="xh" width="50"></el-table-column>
							<el-table-column label="名称" align="center" prop="name" width="300">
								<template slot-scope="scope">
									<el-input v-model="pushList[scope.row.xh-1].name" :disabled="num == 3" placeholder="请输入名称" clearable></el-input>
								</template>
							</el-table-column>
							<el-table-column label="推送内容" align="center" prop="content" width="200">
								<template slot-scope="scope">
									<el-input v-model="pushList[scope.row.xh-1].content" :disabled="num == 3" placeholder="请输入推送内容" clearable></el-input>
								</template>
							</el-table-column>
							<el-table-column label="备注" align="center" prop="remark">
								<template slot-scope="scope">
									<el-input v-model="pushList[scope.row.xh-1].remark" :disabled="num == 3" placeholder="请输入备注" clearable></el-input>
								</template>
							</el-table-column>
						</el-table>
					</div>
				</el-tab-pane>
				<el-tab-pane label="测试环境、时间" name="fourth">
					<div style="margin-top: 15px;">
						<div style="display: flex;justify-content: space-between;padding: 15px;background-color: #fafafa;">
							<div class="item" style="font-size: 15px;font-weight: 800;line-height: 37px;">测试环境和测试设备列表信息：</div>
							<div class="item">
								<el-button type="primary" icon="el-icon-plus" :disabled="num == 3" @click="addequipment">新增</el-button>
								<el-button type="success" icon="el-icon-delete" :disabled="num == 3" @click="equipmenthandleDeleteDetails">删除</el-button>
								<el-button type="danger" icon="el-icon-delete" :disabled="num == 3" @click="equipmenthandleDeleteAllDetails">清空</el-button>
							</div>
						</div>
						<el-table :data="equipmentList"
								  :row-class-name="equipmentName"
								  @selection-change="equipmentSelectionChange"
								  :border="true"
								  ref="equipmenttb"
								  :header-cell-style="{background:'#eef1f6'}"
								  style="width: 100%;">
							<el-table-column type="selection" width="50" align="center" />
							<el-table-column label="序号" align="center" prop="xh" width="50"></el-table-column>
							<el-table-column label="测试环境" align="center" prop="environment " width="300">
								<template slot-scope="scope">
									<el-input v-model="equipmentList[scope.row.xh-1].environment" :disabled="num == 3" placeholder="请输入测试环境" clearable></el-input>
								</template>
							</el-table-column>
							<el-table-column label="版本号" align="center" prop="version" width="200">
								<template slot-scope="scope">
									<el-input v-model="equipmentList[scope.row.xh-1].version" :disabled="num == 3" placeholder="请输入版本号" clearable></el-input>
								</template>
							</el-table-column>
							<el-table-column label="备注" align="center" prop="remark">
								<template slot-scope="scope">
									<el-input v-model="equipmentList[scope.row.xh-1].remark" :disabled="num == 3" placeholder="请输入测试机型系统版本说明或者测试设备的model和名称说明" clearable></el-input>
								</template>
							</el-table-column>
						</el-table>
					</div>
					<div style="margin-top: 15px;">
						<div style="display: flex;justify-content: space-between;padding: 15px;background-color: #fafafa;">
							<div class="item" style="font-size: 15px;font-weight: 800;line-height: 37px;">测试时间：</div>
							<div class="item"></div>
						</div>
						<el-descriptions class="margin-top" :column="1"  border>
							<el-descriptions-item>
								<template slot="label">提测时间</template>
								<el-date-picker
									v-model="form.measureTime "
									type="date"
									:disabled="num == 3"
									style="width: 100%;"
									placeholder="请选择提测时间">
								</el-date-picker>
							</el-descriptions-item>
							<el-descriptions-item>
								<template slot="label">测试日期</template>
								<el-date-picker
									v-model="form.testDate"
									type="daterange"
									align="right"
									:disabled="num == 3"
									unlink-panels
									style="width: 100%;"
									range-separator="至"
									start-placeholder="测试开始日期"
									end-placeholder="测试结束日期"
									:picker-options="pickerOptions">
								</el-date-picker>
							</el-descriptions-item>
							<el-descriptions-item>
								<template slot="label">测试报告</template>
								<el-date-picker
									v-model="form.testReportDate"
									type="date"
									:disabled="num == 3"
									style="width: 100%;"
									placeholder="请选择测试报告时间">
								</el-date-picker>
							</el-descriptions-item>
						</el-descriptions>
					</div>
				</el-tab-pane>
				<el-tab-pane label="测试覆盖" name="five">
					<div style="margin-top: 15px;">
						<div style="display: flex;justify-content: space-between;padding: 15px;background-color: #fafafa;">
							<div class="item" style="font-size: 15px;font-weight: 800;line-height: 37px;">改动点说明</div>
							<div class="item"></div>
						</div>
						<el-descriptions class="test-report" :column="1" border>
							<el-descriptions-item>
								<template slot="label">功能介绍</template>
								<el-input type="textarea" :rows="5" v-model="form.features" :disabled="num == 3" placeholder="请输入功能介绍" clearable></el-input>
							</el-descriptions-item>
							<el-descriptions-item>
								<template slot="label">改动点介绍</template>
								<el-input type="textarea" :rows="5" v-model="form.changePoint" :disabled="num == 3" placeholder="请输入改动点介绍" clearable></el-input>
							</el-descriptions-item>
						</el-descriptions>
					</div>
					<div style="margin-top: 15px;">
						<div style="display: flex;justify-content: space-between;padding: 15px;background-color: #fafafa;">
							<div class="item" style="font-size: 15px;font-weight: 800;line-height: 37px;">测试策略</div>
							<div class="item"></div>
						</div>
						<el-table :data="strategyList"
								  :row-class-name="strategyName"
								  :border="true"
								  ref="equipmenttb"
								  :header-cell-style="{background:'#eef1f6'}"
								  style="width: 100%;">
							<el-table-column label="序号" align="center" prop="xh" width="50"></el-table-column>
							<el-table-column label="用例模块" align="center" prop="caseModule" width="300">
								<template slot-scope="scope">
									<el-input v-model="strategyList[scope.row.xh-1].caseModule" :disabled="num == 3" placeholder="请输入用例模块" clearable></el-input>
								</template>
							</el-table-column>
							<el-table-column label="用例选取策略" align="center" prop="selectionStrategy" width="500">
								<template slot-scope="scope">
									<el-input type="textarea" :rows="2"  v-model="strategyList[scope.row.xh-1].selectionStrategy" :disabled="num == 3" placeholder="请输入用例选取策略" clearable></el-input>
								</template>
							</el-table-column>
							<el-table-column label="选项" align="center" prop="options">
								<template slot-scope="scope">
									<el-radio-group :disabled="num == 3" v-model="strategyList[scope.row.xh-1].options">
										<el-radio label="Pass"></el-radio>
										<el-radio label="Fail"></el-radio>
										<el-radio label="Block"></el-radio>
										<el-radio label="Skip"></el-radio>
										<el-radio label="N/A"></el-radio>
									</el-radio-group>
								</template>
							</el-table-column>
						</el-table>

						<div style="margin-top: 15px;">
							<div style="display: flex;justify-content: space-between;padding: 15px;background-color: #fafafa;">
								<div class="item" style="font-size: 15px;font-weight: 800;line-height: 37px;">产品通用测试</div>
								<div class="item"></div>
							</div>
							<el-descriptions class="test-report" :column="1" border>
								<el-descriptions-item>
									<template slot="label">通用测试</template>
									<el-input type="textarea" :rows="5" :disabled="num == 3" v-model="form.generalTest" placeholder="请输入产品通用测试总结" clearable></el-input>
								</el-descriptions-item>
							</el-descriptions>
						</div>
						<div style="margin-top: 15px;">
							<div style="display: flex;justify-content: space-between;padding: 15px;background-color: #fafafa;">
								<div class="item" style="font-size: 15px;font-weight: 800;line-height: 37px;">产品特有功能测试</div>
								<div class="item"></div>
							</div>
							<el-descriptions class="test-report" :column="1" border>
								<el-descriptions-item>
									<template slot="label">特有功能测试</template>
									<el-input type="textarea" :rows="5" :disabled="num == 3" v-model="form.uniqueFunction" placeholder="请输入特有功能测试总结" clearable></el-input>
								</el-descriptions-item>
							</el-descriptions>
						</div>
						<div style="margin-top: 15px;">
							<div style="display: flex;justify-content: space-between;padding: 15px;background-color: #fafafa;">
								<div class="item" style="font-size: 15px;font-weight: 800;line-height: 37px;">安全测试</div>
								<div class="item"></div>
							</div>
							<el-descriptions class="test-report" :column="1" border>
								<el-descriptions-item>
									<template slot="label">安全测试</template>
									<el-input type="textarea" :rows="5" :disabled="num == 3" v-model="form.safetyTest" placeholder="请输入安全测试总结" clearable></el-input>
								</el-descriptions-item>
							</el-descriptions>
						</div>
						<div style="margin-top: 15px;">
							<div style="display: flex;justify-content: space-between;padding: 15px;background-color: #fafafa;">
								<div class="item" style="font-size: 15px;font-weight: 800;line-height: 37px;">本地化测试</div>
								<div class="item"></div>
							</div>
							<el-descriptions class="test-report" :column="1" border>
								<el-descriptions-item>
									<template slot="label">本地化测试</template>
									<el-input type="textarea" :rows="5" :disabled="num == 3" v-model="form.localizationTest" placeholder="请输入本地化测试总结" clearable></el-input>
								</el-descriptions-item>
							</el-descriptions>
						</div>
						<div style="margin-top: 15px;">
							<div style="display: flex;justify-content: space-between;padding: 15px;background-color: #fafafa;">
								<div class="item" style="font-size: 15px;font-weight: 800;line-height: 37px;">兼容性测试</div>
								<div class="item"></div>
							</div>
							<el-descriptions class="test-report" :column="1" border>
								<el-descriptions-item>
									<template slot="label">兼容性测试</template>
									<el-input type="textarea" :disabled="num == 3" :rows="5" v-model="form.compatibilityTest" placeholder="请输入兼容性测试总结" clearable></el-input>
								</el-descriptions-item>
							</el-descriptions>
						</div>
					</div>
				</el-tab-pane>
				<el-tab-pane label="测试总结" name="six">
					<div style="margin-top: 15px;">
						<div style="display: flex;justify-content: space-between;padding: 15px;background-color: #fafafa;">
							<div class="item" style="font-size: 15px;font-weight: 800;line-height: 37px;">测试结论</div>
							<div class="item"></div>
						</div>
						<el-descriptions class="test-report" :column="2" border>
							<el-descriptions-item>
								<template slot="label">通过/不通过</template>
								<el-radio-group v-model="form.result" :disabled="num == 3">
									<el-radio label="Pass"></el-radio>
									<el-radio label="Fail"></el-radio>
								</el-radio-group>
							</el-descriptions-item>
							<el-descriptions-item>
								<template slot="label">符合/不符合</template>
								<el-radio-group v-model="form.summarizeMeet" :disabled="num == 3">
									<el-radio label="符合"></el-radio>
									<el-radio label="不符合"></el-radio>
								</el-radio-group>
							</el-descriptions-item>
							<el-descriptions-item>
								<template slot="label">需要修复</template>
								<el-input type="number" min="0" :disabled="num == 3" v-model="form.repair" placeholder="请输入需要修复问题笔数" clearable></el-input>
							</el-descriptions-item>
							<el-descriptions-item>
								<template slot="label">后续迭代修复</template>
								<el-input type="number" min="0" :disabled="num == 3" v-model="form.iterativeRepair" placeholder="请输入后续迭代修复问题笔数" clearable></el-input>
							</el-descriptions-item>
						</el-descriptions>
					</div>
					<div style="margin-top: 15px;">
						<div style="display: flex;justify-content: space-between;padding: 15px;background-color: #fafafa;">
							<div class="item" style="font-size: 15px;font-weight: 800;line-height: 37px;">测试问题汇总</div>
							<div class="item">
								<el-button type="primary" :disabled="num == 3" icon="el-icon-plus" @click="addquestionSummary">新增</el-button>
								<el-button type="success" :disabled="num == 3" icon="el-icon-delete" @click="questionSummaryDeleteDetails">删除</el-button>
								<el-button type="danger" :disabled="num == 3" icon="el-icon-delete" @click="questionSummaryDeleteAllDetails">清空</el-button>
							</div>
						</div>
						<el-table :data="questionSummaryList"
								  :border="true"
								  :row-class-name="questionSummaryName"
								  @selection-change="questionSummarySelectionChange"
								  ref="questionSummarytb"
								  :header-cell-style="{background:'#eef1f6'}"
								  style="width: 100%;">
<!--							序号	优先级	总量	模块	数量	主要问题描述-->
							<el-table-column type="selection" width="50" align="center" />
							<el-table-column label="优先级" align="center" prop="grade">
								<template slot-scope="scope">
									<el-input v-model="questionSummaryList[scope.row.xh-1].grade" :disabled="num == 3" placeholder="请输入优先级" clearable></el-input>
								</template>
							</el-table-column>
							<el-table-column label="总量" align="center" prop="total">
								<template slot-scope="scope">
									<el-input v-model="questionSummaryList[scope.row.xh-1].total" :disabled="num == 3" placeholder="请输入总量" clearable></el-input>
								</template>
							</el-table-column>
							<el-table-column label="模块" align="center" prop="module">
								<template slot-scope="scope">
									<el-input v-model="questionSummaryList[scope.row.xh-1].module" :disabled="num == 3" placeholder="请输入模块" clearable></el-input>
								</template>
							</el-table-column>
							<el-table-column label="数量" align="center" prop="number">
								<template slot-scope="scope">
									<el-input v-model="questionSummaryList[scope.row.xh-1].number" :disabled="num == 3" placeholder="请输入数量" clearable></el-input>
								</template>
							</el-table-column>
							<el-table-column label="主要问题描述" align="center" prop="desc">
								<template slot-scope="scope">
									<el-input v-model="questionSummaryList[scope.row.xh-1].desc" :disabled="num == 3" placeholder="请输入主要问题描述" clearable></el-input>
								</template>
							</el-table-column>
						</el-table>
					</div>
					<div style="margin-top: 15px;">
						<div style="display: flex;justify-content: space-between;padding: 15px;background-color: #fafafa;">
							<div class="item" style="font-size: 15px;font-weight: 800;line-height: 37px;">测试问题详细说明</div>
							<div class="item">
								<el-button type="primary" icon="el-icon-plus" :disabled="num == 3" @click="addquestionDetails">新增</el-button>
								<el-button type="success" icon="el-icon-delete" :disabled="num == 3" @click="questionDetailsDeleteDetails">删除</el-button>
								<el-button type="danger" icon="el-icon-delete" :disabled="num == 3" @click="questionDetailsDeleteAllDetails">清空</el-button>
							</div>
						</div>
						<el-table :data="questionDetailsList"
								  :border="true"
								  :row-class-name="questionDetailsName"
								  @selection-change="questionDetailsSelectionChange"
								  ref="questionDetailstb"
								  :header-cell-style="{background:'#eef1f6'}"
								  style="width: 100%;">
							<el-table-column type="selection" width="50" align="center" />
							<el-table-column label="序号" align="center" prop="xh" width="50"></el-table-column>
							<el-table-column label="优先级" align="center" prop="priority" width="400">
								<template slot-scope="scope">
									<el-radio-group v-model="questionDetailsList[scope.row.xh-1].priority" :disabled="num == 3">
										<el-radio label="紧急"></el-radio>
										<el-radio label="严重"></el-radio>
										<el-radio label="重要"></el-radio>
										<el-radio label="次要"></el-radio>
									</el-radio-group>
								</template>
							</el-table-column>
							<el-table-column label="问题描述" align="center" prop="desc" width="300">
								<template slot-scope="scope">
									<el-input type="textarea" :disabled="num == 3" :rows="4" v-model="questionDetailsList[scope.row.xh-1].desc" placeholder="请输入问题描述" clearable></el-input>
								</template>
							</el-table-column>
							<el-table-column label="问题概率" align="center" prop="probability" width="400">
								<template slot-scope="scope">
									<el-radio-group v-model="questionDetailsList[scope.row.xh-1].probability" :disabled="num == 3">
										<el-radio label="必现"></el-radio>
										<el-radio label="高概率"></el-radio>
										<el-radio label="低概率"></el-radio>
										<el-radio label="仅出现1次"></el-radio>
									</el-radio-group>
								</template>
							</el-table-column>
							<el-table-column label="问题单状态" align="center" prop="status" width="300">
								<template slot-scope="scope">
									<el-radio-group v-model="questionDetailsList[scope.row.xh-1].status" :disabled="num == 3">
										<el-radio label="已修复"></el-radio>
										<el-radio label="待修复"></el-radio>
										<el-radio label="非问题"></el-radio>
									</el-radio-group>
								</template>
							</el-table-column>
							<el-table-column label="解决方案建议" align="center" prop="message" width="300">
								<template slot-scope="scope">
									<el-input type="textarea" :disabled="num == 3" :rows="4" v-model="questionDetailsList[scope.row.xh-1].message" placeholder="请输入解决方案建议" clearable></el-input>
								</template>
							</el-table-column>
							<el-table-column label="测试细节" align="center" prop="details" width="300">
								<template slot-scope="scope">
									<el-input type="textarea" :disabled="num == 3" :rows="4" v-model="questionDetailsList[scope.row.xh-1].details" placeholder="请输入测试细节" clearable></el-input>
								</template>
							</el-table-column>
							<el-table-column label="风险分析" align="center" prop="analysis" width="300">
								<template slot-scope="scope">
									<el-input type="textarea" :disabled="num == 3" :rows="4" v-model="questionDetailsList[scope.row.xh-1].analysis" placeholder="请输入风险分析" clearable></el-input>
								</template>
							</el-table-column>
						</el-table>
					</div>
				</el-tab-pane>
				<el-tab-pane label="测试说明" name="seven">
					<div style="margin-top: 15px;">
						<div style="display: flex;justify-content: space-between;padding: 15px;background-color: #fafafa;">
							<div class="item" style="font-size: 15px;font-weight: 800;line-height: 37px;">测试工具说明</div>
							<div class="item"></div>
						</div>
						<el-descriptions class="test-report" :column="1" border>
							<el-descriptions-item>
								<template slot="label">升级测试工具</template>
								<el-input maxlength="4" v-model="form.upgradeTestTool" :disabled="num == 3" placeholder="请输入升级测试工具" clearable></el-input>
							</el-descriptions-item>
							<el-descriptions-item>
								<template slot="label">Spec测试工具</template>
								<el-input v-model="form.specTestTool" :disabled="num == 3" placeholder="请输入Spec测试工具" clearable></el-input>
							</el-descriptions-item>
							<el-descriptions-item>
								<template slot="label">其他测试工具</template>
								<el-input v-model="form.otherTestTool" :disabled="num == 3" placeholder="请输入其他测试工具" clearable></el-input>
							</el-descriptions-item>
						</el-descriptions>
					</div>
					<div style="margin-top: 15px;">
						<div style="display: flex;justify-content: space-between;padding: 15px;background-color: #fafafa;">
							<div class="item" style="font-size: 15px;font-weight: 800;line-height: 37px;">附录</div>
							<div class="item">
								<el-button type="primary" icon="el-icon-plus" :disabled="num == 3" @click="addappendix">新增</el-button>
								<el-button type="success" icon="el-icon-delete" :disabled="num == 3" @click="appendixDeleteDetails">删除</el-button>
								<el-button type="danger" icon="el-icon-delete" :disabled="num == 3" @click="appendixDeleteAllDetails">清空</el-button>
							</div>
						</div>
						<el-table :data="appendixList"
								  :border="true"
								  :row-class-name="appendixName"
								  @selection-change="appendixSelectionChange"
								  ref="appendixtb"
								  :header-cell-style="{background:'#eef1f6'}"
								  style="width: 100%;">
							<el-table-column type="selection" width="50" align="center" />
							<el-table-column label="序号" align="center" prop="xh" width="50"></el-table-column>
							<el-table-column label="文档描述" align="center" prop="priority">
								<template slot-scope="scope">
									<el-input type="textarea" :disabled="num == 3" :rows="2" v-model="appendixList[scope.row.xh-1].desc" placeholder="请输入文档描述" clearable></el-input>
								</template>
							</el-table-column>
							<el-table-column label="用途" align="center" prop="desc">
								<template slot-scope="scope">
									<el-input type="textarea" :disabled="num == 3" :rows="2" v-model="appendixList[scope.row.xh-1].use" placeholder="请输入用途" clearable></el-input>
								</template>
							</el-table-column>
							<el-table-column label="下载地址" align="center" prop="message">
								<template slot-scope="scope">
									<el-input v-model="appendixList[scope.row.xh-1].url" :disabled="num == 3" placeholder="请输入下载地址" clearable></el-input>
								</template>
							</el-table-column>
						</el-table>
					</div>
				</el-tab-pane>
			</el-tabs>
		</div>
		</el-form>
		<div class="tabsfooter">
			<div class="btn">
				<el-button @click="back()">返 回</el-button>
				<el-button type="primary" @click="submit('form')" v-if="num != 3">提 交</el-button>
			</div>

		</div>

	</div>
</template>

<script>
import { report, taskId, orderDetail, reportId, reportEdit, orderOptions } from '@/api/user'
export default {
	data(){
		return {
			id:'',
			listId:'',
			num:'',
			activeName:'first',
			form:{
				product_model:'',
				milestone:'',
				brand_type:'',
				server:'',
				salesArea:''
			},
			rules:{
				company:[
					{max: 36, message: '申请公司不能超过36个字符', trigger: 'blur'},
					{ required: true, message: '请输入申请公司', trigger: 'blur' }
				],
				product_name:[
					{max: 36, message: '产品名称不能超过36个字符', trigger: 'blur'},
					{ required: true, message: '请输入产品名称', trigger: 'blur' }
					],
				product_model:[{max: 36, message: '产品Model不能超过36个字符', trigger: 'blur'}],
				prototype_did:[{max: 50, message: '测试设备DID不能超过50个字符', trigger: 'blur'}]
			},
			pickerOptions: {
				shortcuts: [{
					text: '本月',
					onClick(picker) {
						picker.$emit('pick', [new Date(), new Date()]);
					}
				}, {
					text: '今年至今',
					onClick(picker) {
						const end = new Date();
						const start = new Date(new Date().getFullYear(), 0);
						picker.$emit('pick', [start, end]);
					}
				}, {
					text: '最近六个月',
					onClick(picker) {
						const end = new Date();
						const start = new Date();
						start.setMonth(start.getMonth() - 6);
						picker.$emit('pick', [start, end]);
					}
				}]
			},
			titname:'米家接入认证测试报告',
			bcglXiangXiList:[
				{
					problemSummary:'',
					probability:'',
					grade:'',
					step:'',
					means:'',
					analyze:'',
					suggest:''
				}
			],
			//选中的从表数据
			checkedDetail: [],

			approverList:[
				{
					departmentName:'',
					sign:'',
					date:''
				}
			],
			approverCheckedDetail:[],

			revisionRecordList:[
				{
					version:'',
					auther:'',
					date:'',
					change:''
				}
			],
			revisionRecordCheckedDetail:[],

			testRangeListTwo:[],
			testRangeList:[
				{
					checked:false,
					testObject:'米家扩展程序',
					version:'XXX',
					remark:'若单独测试扩展程序，需要备注中明确搭配测试的固件版本号'
				},
				{
					checked:false,
					testObject:'设备固件',
					version:'XXX/不涉及',
					remark:'若单独测试扩展程序，需要备注中明确搭配测试的固件版本号'
				},
				{
					checked:false,
					testObject:'自动化场景',
					version:'XXX/不涉及',
					remark:'XX条if，XX条then'
				},
				{
					checked:false,
					testObject:'消息推送',
					version:'XXX/不涉及',
					remark:'XX条push消息'
				},
				{
					checked:false,
					testObject:'隐私政策',
					version:'XXX/不涉及',
					remark:'封样提测、扩展程序迭代修改隐私涉及；明确绑定XX版本的扩展程序进行测试'
				},
				{
					checked:false,
					testObject:'用户协议',
					version:'XXX/不涉及',
					remark:'封样提测、扩展程序迭代修改隐私涉及；明确绑定XX版本的扩展程序进行测试'
				},
				{
					checked:false,
					testObject:'独立APP',
					version:'XXX/不涉及',
					remark:'独立APP测试；搭配独立APP的功能测试'
				},
				{
					checked:false,
					testObject:'微信小程序',
					version:'XXX/不涉及',
					remark:'独立微信小程序测试；搭配微信小程序的功能测试'
				}
			],
			testRangeRecordCheckedDetail:[],  //被选中的测试范围

			automationList:[
				{
					type:'',
					name:'',
					remark:''
				}
			],
			automationListCheckedDetail:[], //被选中自动化场景清单列表

			pushList:[
				{
					content:'',
					name:'',
					remark:''
				}
			],
			pushListCheckedDetail:[],  // 被选中Push消息清单列表

			equipmentList:[
				{
					environment:'',
					version:'',
					remark:''
				}
			],
			equipmentCheckedDetail:[],  //被选中测试环境和测试设备列表

			strategyList:[
				{
					caseModule:'产品通用',
					selectionStrategy:'全覆盖、XX模块全覆盖，其余模块选择P0覆盖、未覆盖',
					options:''
				},
				{
					caseModule:'产品特有功能',
					selectionStrategy:'全覆盖、XX模块全覆盖，其余模块选择P0覆盖、未覆盖',
					options:''
				},
				{
					caseModule:'安全',
					selectionStrategy:'全覆盖、XX模块全覆盖，其余模块选择P0覆盖、未覆盖',
					options:''
				},
				{
					caseModule:'本地化',
					selectionStrategy:'测试语言XX/XX，全模块覆盖、XX模块全覆盖，其余模块选择P0覆盖、未覆盖',
					options:''
				},
				{
					caseModule:'兼容性',
					selectionStrategy:'全覆盖、XX模块全覆盖，其余模块选择P0覆盖、未覆盖',
					options:''
				}
			],

			questionSummaryList:[
				{
					grade:'',
					total:'',
					module:'',
					number:'',
					desc:''
				}
			],
			questionSummaryCheckedDetail:[], //被选中测试问题详细说明

			questionDetailsList:[
				{
					priority:'',
					desc:'',
					probability:'',
					status:'',
					message:'',
					details:'',
					analysis:''
				}
			],
			questionDetailsCheckedDetail:[], //被选中测试问题详细说明

			appendixList:[
				{
					desc:'',
					use:'',
					url:''
				}
			],
			appendixCheckedDetail:[], // 被选中附录

			testOption:[], // 测试内容列表
			salesOption:[],  // 销售区域列表


		}
	},
	created() {
		this.id = this.$route.params.id
		this.num = this.$route.params.num
		if(this.num == 2 || this.num == 3){
			this.listId = this.$route.params.id
		}


		this.initData(this.$route.params.num, this.$route.params.id)
	},
	mounted() {

	},
	methods: {
		checkedChange(data){
			console.log(data,345345345)
		},
		// 服务器选择事件
		areaChange(e){
			this.salesOption.filter(item => {
				if(item['name'] == e){
					this.form.server = item['server']
				}
			})
		},
		getDetail(){
			reportId(this.id).then(res => {
				let test_content_data = []
				this.id = res.data.task_id
				this.form = Object.assign({},res.data.form)
				res.data.form.test_content.filter(item => {
					test_content_data.push(item)
				})

				this.form.test_content = test_content_data
				this.bcglXiangXiList = res.data.bcglXiangXiList,
				this.approverList= res.data.approverList,
				this.revisionRecordList= res.data.revisionRecordList,
				this.testRangeList= res.data.testRangeList,
				this.automationList= res.data.automationList,
				this.pushList= res.data.pushList,
				this.equipmentList= res.data.equipmentList,
				this.strategyList= res.data.strategyList,
				this.questionSummaryList= res.data.questionSummaryList,
				this.questionDetailsList= res.data.questionDetailsList,
				this.appendixList= res.data.appendixList
			})
		},
		// 任务详情
		initData(num,data){
				// 1:新增 2:修改 3:查看
			if(num == 1){
				taskId(data).then(res => {
					// 订单信息
					orderDetail(res.data.order_id).then(res => {
						let test_content_data = []
						this.form.product_model = res.data.project_name
						this.form.milestone = res.data.milepost
						this.form.brand_type = res.data.brand_type
						this.form.server = res.data.server

						res.data.test_content.filter(item => {
							test_content_data.push(item['test_content'])
						})

						this.form.test_content = test_content_data
						this.form.salesArea = res.data.sales_area
					})
				})
			}

			if(num == 2){
				this.getDetail()

			}

			if(num == 3){
				this.getDetail()
			}

			orderOptions().then(res => {
				let data = res.data

				this.salesOption = data.sales_area_list

				data.test_content_list.filter(item => {
					this.testOption.push({name:item})
				})
			})

		},
		// 返回
		back() {
			this.$router.go(-1)
		},
		// 提交
		submit(form){

			let data = {
				task_id:this.id,
				result:this.form.result,
				company:this.form.company,
				product_name:this.form.product_name,
				product_model:this.form.product_model,
				prototype_did:this.form.prototype_did,
				brand_type:this.form.brand_type,
				bcglXiangXiList:this.bcglXiangXiList,
				approverList:this.approverList,
				revisionRecordList:this.revisionRecordList,
				testRangeList:this.testRangeList,
				automationList:this.automationList,
				pushList:this.pushList,
				equipmentList:this.equipmentList,
				strategyList:this.strategyList,
				questionSummaryList:this.questionSummaryList,
				questionDetailsList:this.questionDetailsList,
				appendixList:this.appendixList,
				form:this.form
			}
			this.$refs[form].validate((valid) => {
				if(valid){
					if(this.num == 1){
						report(data).then(res => {
							if(res.status == 'success'){
								this.bcglXiangXiList = []
								this.approverList = []
								this.revisionRecordList = []
								this.testRangeList = []
								this.automationList = []
								this.pushList = []
								this.equipmentList = []
								this.strategyList = []
								this.questionSummaryList = []
								this.questionDetailsList = []
								this.appendixList = []
								this.form = {
									product_model:'',
									milestone:'',
									brand_type:'',
									server:'',
									salesArea:''
								}
								this.back()
							}
						})
					}
					if(this.num == 2){
				reportEdit(data,this.listId).then(res => {
					if(res.status == 'success'){
						this.bcglXiangXiList = []
						this.approverList = []
						this.revisionRecordList = []
						this.testRangeList = []
						this.automationList = []
						this.pushList = []
						this.equipmentList = []
						this.strategyList = []
						this.questionSummaryList = []
						this.questionDetailsList = []
						this.appendixList = []
						this.form = {
							product_model:'',
							milestone:'',
							brand_type:'',
							server:'',
							salesArea:''
						}
						this.back()
					}
				})
			}
				}
			})

		},
		handleClick(tab, event) {
			console.log(tab, event);
		},
		addQuestion(){
			if (this.bcglXiangXiList == undefined) {
				this.bcglXiangXiList = new Array();
			}
			let data = {
				problemSummary:'',
				probability:'',
				grade:'',
				step:'',
				means:'',
				analyze:'',
				suggest:''
			}
			this.bcglXiangXiList.push(data)
			this.$message.success('新增成功！')
		},

		// 附件开始
		rowClassName({ row, rowIndex }) {
			row.xh = rowIndex + 1;
		},
		//单选框选中数据
		handleDetailSelectionChange(selection) {
			if (selection.length > 1) {
				this.$refs.tb.clearSelection();
				this.$refs.tb.toggleRowSelection(selection.pop());
			} else {
				this.checkedDetail = selection;
			}
		},
		// 删除
		handleDeleteDetails() {
			if (this.checkedDetail.length == 0) {
				this.$alert("请先选择要删除的数据", "提示", {
					confirmButtonText: "确定",
				});
			} else {
				this.bcglXiangXiList.splice(this.checkedDetail[0].xh - 1, 1);
				this.$message.success('成功删除！')
			}
		},
		// 清空
		handleDeleteAllDetails() {
			this.bcglXiangXiList = undefined;
			this.$message.success('成功清空！')
		},
		// 附件结束

		// 审批人开始
		approverName({ row, rowIndex }) {
			row.xh = rowIndex + 1;
		},
		approverSelectionChange(selection) {
			if (selection.length > 1) {
				this.$refs.approvertb.clearSelection();
				this.$refs.approvertb.toggleRowSelection(selection.pop());
			} else {
				this.approverCheckedDetail = selection;
			}
		},
		addapprover(){
			if (this.approverList == undefined) {
				this.approverList = new Array();
			}
			let data = {
				departmentName:'',
				sign:'',
				date:''
			}
			this.approverList.push(data)
			this.$message.success('新增成功！')
		},
		approverhandleDeleteDetails(){
			if (this.approverCheckedDetail.length == 0) {
				this.$alert("请先选择要删除的数据", "提示", {
					confirmButtonText: "确定",
				});
			} else {
				this.approverList.splice(this.approverCheckedDetail[0].xh - 1, 1);
				this.$message.success('成功删除！')
			}
		},
		approverhandleDeleteAllDetails(){
			this.approverList = undefined;
			this.$message.success('成功清空！')
		},
		// 审批人结束

		// 修订记录开始
		revisionName({ row, rowIndex }) {
			row.xh = rowIndex + 1;
		},
		revisionSelectionChange(selection) {
			if (selection.length > 1) {
				this.$refs.revisiontb.clearSelection();
				this.$refs.revisiontb.toggleRowSelection(selection.pop());
			} else {
				this.revisionRecordCheckedDetail = selection;
			}
		},
		addrevision(){
			if (this.revisionRecordList == undefined) {
				this.revisionRecordList = new Array();
			}
			let data = {
				version:'',
				auther:'',
				date:'',
				change:''
			}
			this.revisionRecordList.push(data)
			this.$message.success('新增成功！')
		},
		revisionhandleDeleteDetails(){
			if (this.revisionRecordCheckedDetail.length == 0) {
				this.$alert("请先选择要删除的数据", "提示", {
					confirmButtonText: "确定",
				});
			} else {
				this.revisionRecordList.splice(this.revisionRecordCheckedDetail[0].xh - 1, 1);
				this.$message.success('成功删除！')
			}
		},
		revisionhandleDeleteAllDetails(){
			this.revisionRecordList = undefined;
			this.$message.success('成功清空！')
		},
		// 修订记录结束

		// 测试范围开始
		testRangeSelectionChange(selection){
			this.testRangeRecordCheckedDetail = selection
		},
		// 测试范围结束

		// 自动化场景开始
		automationName({ row, rowIndex }) {
			row.xh = rowIndex + 1;
		},
		automationSelectionChange(selection) {
			if (selection.length > 1) {
				this.$refs.automationtb.clearSelection();
				this.$refs.automationtb.toggleRowSelection(selection.pop());
			} else {
				this.automationListCheckedDetail = selection;
			}
		},
		addreautomation(){
			if (this.automationList == undefined) {
				this.automationList = new Array();
			}
			let data = {
				type:'',
				name:'',
				remark:''
			}
			this.automationList.push(data)
			this.$message.success('新增成功！')
		},
		automationhandleDeleteDetails(){
			if (this.automationListCheckedDetail.length == 0) {
				this.$alert("请先选择要删除的数据", "提示", {
					confirmButtonText: "确定",
				});
			} else {
				this.automationList.splice(this.automationListCheckedDetail[0].xh - 1, 1);
				this.$message.success('成功删除！')
			}
		},
		automationhandleDeleteAllDetails(){
			this.automationList = undefined;
			this.$message.success('成功清空！')
		},
		// 自动化场景结束

		// Push消息清单列表开始
		pushName({ row, rowIndex }) {
			row.xh = rowIndex + 1;
		},
		pushSelectionChange(selection) {
			if (selection.length > 1) {
				this.$refs.pushtb.clearSelection();
				this.$refs.pushtb.toggleRowSelection(selection.pop());
			} else {
				this.pushListCheckedDetail = selection;
			}
		},
		addpush(){
			if (this.pushList == undefined) {
				this.pushList = new Array();
			}
			let data = {
				content:'',
				name:'',
				remark:''
			}
			this.pushList.push(data)
			this.$message.success('新增成功！')
		},
		pushhandleDeleteDetails(){
			if (this.pushListCheckedDetail.length == 0) {
				this.$alert("请先选择要删除的数据", "提示", {
					confirmButtonText: "确定",
				});
			} else {
				this.pushList.splice(this.pushListCheckedDetail[0].xh - 1, 1);
				this.$message.success('成功删除！')
			}
		},
		pushhandleDeleteAllDetails(){
			this.pushList = undefined;
			this.$message.success('成功清空！')
		},
		// Push消息清单列表结束

		// 测试环境和测试设备列表开始
		equipmentName({ row, rowIndex }) {
			row.xh = rowIndex + 1;
		},
		equipmentSelectionChange(selection) {
			if (selection.length > 1) {
				this.$refs.equipmenttb.clearSelection();
				this.$refs.equipmenttb.toggleRowSelection(selection.pop());
			} else {
				this.equipmentCheckedDetail = selection;
			}
		},
		addequipment(){
			if (this.equipmentList == undefined) {
				this.equipmentList = new Array();
			}
			let data = {
				environment:'',
				version:'',
				remark:''
			}
			this.equipmentList.push(data)
			this.$message.success('新增成功！')
		},
		equipmenthandleDeleteDetails(){
			if (this.equipmentCheckedDetail.length == 0) {
				this.$alert("请先选择要删除的数据", "提示", {
					confirmButtonText: "确定",
				});
			} else {
				this.equipmentList.splice(this.equipmentCheckedDetail[0].xh - 1, 1);
				this.$message.success('成功删除！')
			}
		},
		equipmenthandleDeleteAllDetails(){
			this.equipmentList = undefined;
			this.$message.success('成功清空！')
		},
		// 测试环境和测试设备列表结束

		//
		strategyName({ row, rowIndex }) {
			row.xh = rowIndex + 1;
		},
		// 测试问题汇总开始
		questionSummaryName({ row, rowIndex }) {
			row.xh = rowIndex + 1;
		},
		questionSummarySelectionChange(selection) {
			if (selection.length > 1) {
				this.$refs.questionSummarytb.clearSelection();
				this.$refs.questionSummarytb.toggleRowSelection(selection.pop());
			} else {
				this.questionSummaryCheckedDetail = selection;
			}
		},
		addquestionSummary(){
			if (this.questionSummaryList == undefined) {
				this.questionSummaryList = new Array();
			}
			let data = {
				grade:'',
				total:'',
				module:'',
				number:'',
				desc:''
			}
			this.questionSummaryList.push(data)
			this.$message.success('新增成功！')
		},
		questionSummaryDeleteDetails(){
			if (this.questionSummaryCheckedDetail.length == 0) {
				this.$alert("请先选择要删除的数据", "提示", {
					confirmButtonText: "确定",
				});
			} else {
				this.questionSummaryList.splice(this.questionSummaryCheckedDetail[0].xh - 1, 1);
				this.$message.success('成功删除！')
			}
		},
		questionSummaryDeleteAllDetails(){
			this.questionSummaryList = undefined;
			this.$message.success('成功清空！')
		},
		// 测试问题汇总结束

		// 测试问题详细说明开始
		questionDetailsName({ row, rowIndex }) {
			row.xh = rowIndex + 1;
		},
		questionDetailsSelectionChange(selection) {
			if (selection.length > 1) {
				this.$refs.questionDetailstb.clearSelection();
				this.$refs.questionDetailstb.toggleRowSelection(selection.pop());
			} else {
				this.questionDetailsCheckedDetail = selection;
			}
		},
		addquestionDetails(){
			if (this.questionDetailsList == undefined) {
				this.questionDetailsList = new Array();
			}
			let data = {
				priority:'',
				desc:'',
				probability:'',
				status:'',
				message:'',
				details:'',
				analysis:''
			}
			this.questionDetailsList.push(data)
			this.$message.success('新增成功！')
		},
		questionDetailsDeleteDetails(){
			if (this.questionDetailsCheckedDetail.length == 0) {
				this.$alert("请先选择要删除的数据", "提示", {
					confirmButtonText: "确定",
				});
			} else {
				this.questionDetailsList.splice(this.questionDetailsCheckedDetail[0].xh - 1, 1);
				this.$message.success('成功删除！')
			}
		},
		questionDetailsDeleteAllDetails(){
			this.questionDetailsList = undefined;
			this.$message.success('成功清空！')
		},
		// 测试问题详细说明结束

		// 附录开始
		appendixName({ row, rowIndex }) {
			row.xh = rowIndex + 1;
		},
		appendixSelectionChange(selection) {
			if (selection.length > 1) {
				this.$refs.appendixtb.clearSelection();
				this.$refs.appendixtb.toggleRowSelection(selection.pop());
			} else {
				this.appendixCheckedDetail = selection;
			}
		},
		addappendix(){
			if (this.appendixList == undefined) {
				this.appendixList = new Array();
			}
			let data = {
				desc:'',
				use:'',
				url:''
			}
			this.appendixList.push(data)
			this.$message.success('新增成功！')
		},
		appendixDeleteDetails(){
			if (this.appendixCheckedDetail.length == 0) {
				this.$alert("请先选择要删除的数据", "提示", {
					confirmButtonText: "确定",
				});
			} else {
				this.appendixList.splice(this.appendixCheckedDetail[0].xh - 1, 1);
				this.$message.success('成功删除！')
			}
		},
		appendixDeleteAllDetails(){
			this.appendixList = undefined;
			this.$message.success('成功清空！')
		},
		// 附录结束
	}
}
</script>

<style lang="scss" scoped>
.content{
	background-color: #fff;
	margin: 15px;
	/deep/ .el-form-item {
		 margin-bottom: 0px;
	}
	.tabs{
		padding: 15px 10px;
		margin-bottom: 110px;
		.test-report{
			margin-top: 15px;
		}
	}
	/deep/ .el-descriptions--medium.is-bordered th, .el-descriptions--medium.is-bordered td {
		padding: 10px;
		text-align: center;
		width: 200px;
	}
	.tabsfooter{
		z-index: 999;
		position: fixed;
		bottom: 5px;
		background: #fff;
		width: calc(100% - 210px);
		right: 0;
		height: 50px;
		line-height: 48px;
		margin-bottom: 40px;
		padding-right: 2%;
		text-align: right;
		//.btn{
		//	width: calc(100% - 420px);
		//}

	}
}
</style>
